<template lang="html">
  <div class="form-box">
    <group class="input-defalut">
      <x-input placeholder="输入姓名" :min="2" :max="6" type="text" is-type="china-name" required ref="input01" @on-change="onChange">
        <img src="../../assets/bussiness-man.png" alt="" slot="label" class="input-icon">
      </x-input>
    </group>
    <group class="input-defalut">
      <x-input placeholder="输入身份证" :max="18" :min="15" type="text" required ref="input02" @on-change="onChange">
        <img src="../../assets/bussiness-card.png" alt="" slot="label" class="input-icon">
      </x-input>
    </group>
    <div class="btn-box">
      <x-button class="btn" @click.native="next()" :disabled="!valid1||!valid2">下一步{{$route.showFoot}}</x-button>
    </div>
  </div>
</template>

<script>
import { Group, XInput, XButton } from 'vux'
import { mapMutations } from 'vuex'
export default {
  name: 'Authentication',
  data () {
    return {
      AuthenticationShow: true,
      valid1: false,
      valid2: false
    }
  },
  components: {
    Group,
    XInput,
    XButton
  },
  created () {
    this.setFooter(false)
    this.setShowBack(true)
  },
  methods: {
    next () {
      this.setLogin(true)
    },
    onChange () {
      this.valid1 = this.$refs.input01.valid
      this.valid2 = this.$refs.input02.valid
    },
    ...mapMutations({
      setLogin: 'setPopup',
      setFooter: 'setFooter',
      setShowBack: 'setShowBack'
    })
  }
}
</script>

<style lang="css">
</style>
